/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <xml/Object.h>
#include <filesystem/String.hpp>
#include <memory>

#include <SharedRep.h>

namespace liba {
namespace font {

class AbstractFont;

class GenericFontRep
{
public:
	GenericFontRep(const filesystem::String& name);
	~GenericFontRep();

	AbstractFont* GetAbstractFont() const { return font.get(); }
private:
	std::auto_ptr<AbstractFont> font;
};

class GenericFont 
	: public Shared<filesystem::String, GenericFontRep>
{
public:
	GenericFont(const filesystem::String & name)
	{
		load_rep(name);
	}

	AbstractFont* GetAbstractFont() const
	{
		return get_rep()->GetAbstractFont();
	}
};

} // namespace liba
} // namespace font
